package cn.huanzi.qch.springbootmybatis.controller;

import cn.huanzi.qch.springbootmybatis.dingding.DingTalkMessageSender;
import com.google.common.base.Throwables;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author keven
 * @date 2023-02-09 3:56 下午
 * @Description
 */
@RestController
public class TestController {


    @Autowired
    private DingTalkMessageSender dingTalkMessageSender;

    @GetMapping("testSend")
    public void testSend() {
        try {
            int i = 3;
            int b = i/0;
        }catch (Exception e) {
            dingTalkMessageSender.sendTextMessage(Throwables.getStackTraceAsString(e));
        }
    }
}
